<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <title>传智健康</title>
    <meta content="传智健康" name="description">
    <meta content="传智健康" name="keywords">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <script src="../js/vue.js"></script>
    <link href="../css/style.css" rel="stylesheet" type="text/css">
    <script src="../plugins/echarts/echarts.js"></script>
    <script src="../js/axios-0.18.0.js"></script>
    <link href="../plugins/elementui/lib/theme-chalk/index.css" rel="stylesheet">
    <script src="../plugins/elementui/lib/index.js"></script>

</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>统计分析
            <small>会员数量</small>

        </h1>
        <el-breadcrumb class="breadcrumb" separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>统计分析</el-breadcrumb-item>
            <el-breadcrumb-item>会员数量</el-breadcrumb-item>
        </el-breadcrumb>
    </div>

    <div class="block">
        <span class="demonstration"></span>
        <el-date-picker
                :picker-options="picker"
                @change="picker(

                )"
                end-placeholder="结束日期"
                range-separator="至"
                start-placeholder="开始日期"
                type="datetimerange"
                v-model="value1"
                value-format="yyyy-MM-dd">
        </el-date-picker>
    </div>

    <div class="box">
        <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
        <div id="chart1" style="height:600px;"></div>
    </div>

</div>
</body>
<!-- 引入组件库 -->
<script type="text/javascript">
    new Vue({
        el: "#app",
        data: {
            value1: []
        },

        methods: {
            picker() {
                axios.post("/report/getMemberLine.do", this.value1).then((res) => {

                    // 基于准备好的dom，初始化echarts实例
                    var myChart1 = echarts.init(document.getElementById('chart1'));
                    //发送ajax请求获取动态数据
                    myChart1.setOption ( {
                        title: {
                            text: '每日预约数和体检数统计表',
                            subtext: '房佳龙'
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            data: ['每日预约数', '每日到诊数','平均数1','平均数2']
                        },
                        toolbox: {
                            show: true,
                            feature: {
                                dataZoom: {
                                    yAxisIndex: 'none'
                                },
                                dataView: {readOnly: false},
                                magicType: {type: ['line', 'bar']},
                                restore: {},
                                saveAsImage: {}
                            }
                        },
                        xAxis: {
                            type: 'category',
                            boundaryGap: false,
                            data: res.data.data.dateDay
                            /*data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']*/
                        },
                        yAxis: {
                            type: 'value',
                            axisLabel: {
                                formatter: '{value}'
                            }
                        },
                        series: [
                            {
                                name: '每日预约数',
                                type: 'line',
                                data: res.data.data.lineOrder,
                                markPoint: {
                                    data: res.data.data.max
                                    /*[
                                        {type: 'max', name: '最大值'},
                                        {type: 'min', name: '最小值'}
                                    ]*/
                                },
                                markLine: {
                                    data: [
                                        {type: 'average', name: '平均值1'}
                                    ]
                                }
                            },

                            {
                                name: '每日到诊数',
                                type: 'line',
                                data: res.data.data.lineDiagnosis,
                                markPoint: {
                                    data: res.data.data.min
                                    /*[
                                        {name: '周最低', value: -2, xAxis: 1, yAxis: -1.5}
                                    ]*/
                                },markLine: {
                                    data: [
                                        {type: 'average', name: '平均值2'}
                                    ]

                                },
                                markLine: {
                                    data: [
                                        {type: 'average', name: '平均值'},
                                        [{
                                            symbol: 'none',
                                            x: '90%',
                                            yAxis: 'max'
                                        }, {
                                            symbol: 'circle',
                                            label: {
                                                position: 'start',
                                                formatter: '最大值'
                                            },
                                            type: 'max',
                                            name: '最高点'
                                        }]
                                    ]
                                }
                            }
                        ]
                    })

                })
            }

        }
    });

</script>
</html>
